Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Defining Your Own User Pane Functions /


MyUserPaneActivateProc

NEW WITH THE APPEARANCE MANAGER

Handles activate and deactivate event processing.

The Control Manager declares the type for an application-defined user pane activate function as follows:

typedef pascal void (*ControlUserPaneActivateProc)(
                              ControlHandle control,
                              Boolean activating);
The Control Manager defines the data type UserPaneActivateUPP to identify the universal procedure pointer for this application-defined function:

typedef UniversalProcPtr ControlUserPaneActivateUPP;
You typically use the NewControlUserPaneActivateProc macro like this:

ControlUserPaneActivateUPP myControlUserPaneActivateUPP;
myControlUserPaneActivateUPP = NewControlUserPaneActivateProc 
(MyUserPaneActivate);
You typically use the CallControlUserPaneActivateProc macro like this:

CallControlUserPaneActivateProc(myControlUserPaneActivateUPP, control, 
activating);
Here's how to declare the function MyUserPaneActivateProc:

pascal void MyUserPaneActivateProc (
                     ControlHandle control
                     Boolean activating);
control
A handle to the control in which the activate event occurred.
activating
A Boolean value indicating whether or not the control is being activated. If true, the control is being activated. If false, the control is being deactivated.
DISCUSSION
Your MyUserPaneActivateProc function should perform any special processing before the user pane becomes activated or deactivated. For example, it should deactivate its TEHandle or ListHandle if the user pane is about to be deactivated.

This function will only get called if you've set the kControlWantsActivate feature bit on creation of the user pane control. Once you have created the function MyUserPaneActivateProc, pass kControlUserPaneActivateProcTag in the tagName parameter of SetControlData.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998